package cn.edu.ctbu.sbadmin.grade.service.impl;


import cn.edu.ctbu.sbadmin.common.core.AbstractService;
import cn.edu.ctbu.sbadmin.grade.dao.SubjectDao;
import cn.edu.ctbu.sbadmin.grade.domain.SubjectDO;
import cn.edu.ctbu.sbadmin.grade.service.SubjectService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
@Service
public class SubjectServiceImpl extends AbstractService<SubjectDao, SubjectDO> implements SubjectService {

    @Autowired
    private SubjectDao subjectDao;

    public List<SubjectDO> getNullSubject(String professionType){
        QueryWrapper<SubjectDO> queryWrapper = new QueryWrapper<>();
        queryWrapper.isNull("student_id");
        if(professionType.contains("物联网")){
            professionType = "物联网";
        }
        else {
            professionType = "计算机";
        }
        queryWrapper.like("profession_type",professionType);
        List<SubjectDO> subjectDOList = subjectDao.getNullSubject(queryWrapper);
        return subjectDOList;
    }

}
